/**
 * Project Name:JavaBaseReview
 * Package Name:com.xuwei.base.enumeration
 * author:David
 * Date:2016年6月7日上午9:13:27
 * Copyright (c) 2016, xw123box@126.com All Rights Reserved.
 *
 */
package com.xuwei.base.enumeration;

/**
 * @author David
 * @since 2016年6月7日 上午9:13:27
 * @version 
 * @since JDK 1.6
 */
public class Demo3 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		WeekDay mon = WeekDay.MON;
		System.out.println(mon.toLocaleString());
		System.out.println(WeekDay.FRI.name());
		System.out.println(WeekDay.FRI.ordinal());
		System.out.println(WeekDay.valueOf("THU").toLocaleString());
		
		for(WeekDay wd:WeekDay.values()){
			System.out.println(wd.name());
		}
	}

}

enum WeekDay{
	MON{

		@Override
		public String toLocaleString() {
			return "星期一";
		}
		
	},TUE{

		@Override
		public String toLocaleString() {
			return "星期二";
		}
		
	},WED{

		@Override
		public String toLocaleString() {
			return "星期三";
		}
		
	},THU{

		@Override
		public String toLocaleString() {
			return "星期四";
		}
		
	},FRI{

		@Override
		public String toLocaleString() {
			return "星期五";
		}
		
	},SAT{

		@Override
		public String toLocaleString() {
			return "星期六";
		}
		
	},SUN{

		@Override
		public String toLocaleString() {
			return "星期日";
		}
		
	};
	public abstract String toLocaleString();
}
